package com.lei2j;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.util.PathMatcher;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@EnableDiscoveryClient
@RestController
//此注解用于刷新属性
@RefreshScope
public class ConfigClientApplication
{
    public static void main( String[] args ){
        SpringApplication.run(ConfigClientApplication.class,args);
    }

    @Value("${foo}")
    private String foo;

    @Value("${profile}")
    private String profile;

    @RequestMapping("/test")
    public String test(){
        return "foo:"+foo+",profile:"+profile;
    }
}
